// 协同管理模块接口
import request from '@/http/request';
const apiUrl = 'bf-assets';

// -----------协同审批相关接口----------
export const collaborativeApproval = {
    getXinZuAgreementList: (param) => request.post(`${apiUrl}/leaseContract/getListPage`, param),// 查询新租合同list
    getHuiShenForm: (contractId) => request.get(`${apiUrl}/leaseContract/getJointHearing/${contractId}`),// 查询会审单
    getNewLeaseFlows:(param) => request.post(`${apiUrl}/flow/getNewLeaseFlows`, param),// 新租/补充协议
    getPropertyAcceptance:(param) => request.post(`${apiUrl}/leaseManage/getPropertyAcceptance`, param),// 获取物业交接列表
    getRentOutContractPage:(param) => request.post(`${apiUrl}/flow/getRentOutContractPage`, param),// 分页查询退租流程的合同
    getSupplementaryAgreementContract:(param) => request.post(`${apiUrl}/supplementaryAgreement/getList`, param),// 分页查询补充协议合同
    getNewLeaseHisFlows:(param) => request.post(`${apiUrl}/flow/getNewLeaseHisFlows`, param),// 分页查询新租合同历史
    confirmSign:(param) => request.post(`${apiUrl}/contract/confirmSign`, param),// 确认签约
};

// -----------合同相关接口----------
export const contractApi = {
    getContractTemplates: (param) => request.post(`${apiUrl}/contract/getContractTemplates`, param),// 查询所有合同模板
    getContractTemplatesPage:(param) => request.post(`${apiUrl}/contract/getContractTemplatesPage`,param),// 分页获取合同模板
    bindData:(param) => request.post(`${apiUrl}/contract/bindData/${param.templateUrlKey}`, param.param),// 根据绑定数据预览合同
    bindData2:(param) => request.post(`${apiUrl}/contract/bindData2/${param.templateUrlKey}`, param.param),// 根据绑定数据预览合同
    getCacheCheckupInfo:(param)=> request.get(`${apiUrl}/contract/getCacheCheckupInfo?contractId=${param.contractId}`),// 查询确实前会审单信息
    saveContractWord:(param) => request.post(`${apiUrl}/contract/saveContractWord`, param),// 保存合同word编辑后信息
}

// -----------合同退租相关接口----------
export const thorwLeaseApi = {
    getLeasingContractPage:(param) => request.post(`${apiUrl}/rentOut/getLeasingContractPage`, param), // 分页查询租赁中的合同
    getCustomerBank: (contractId) => request.get(`${apiUrl}/bank/getCustomerBank?contractId=${contractId}`), // 根据合同id查询客户所有银行账户信息
    saveBindData:(param) => request.post(`${apiUrl}/rentOut/cache/saveBindData`, param),// 第一步，保存绑定数据
    // getRentOutWord:(contractId) => request.get(`${apiUrl}/rentOut/cache/getRentOutWord/${contractId}`),// 第一步，获取word
    // getBindDataWord:(param) => request.get(`${apiUrl}/rentOut/cache/getBindDataWord`)// 第二步，获取word
    // getContractTemplates: (param) => request.post(`${apiUrl}/contract/getContractTemplates`, param),// 查询合同模板
    // bindData:(param) => request.post(`${apiUrl}/contract/bindData/${param.templateUrlKey}`, param.param),// 根据绑定数据预览合同
    // getCheckupInfoByContractTemplateId:(param)=> request.get(`${apiUrl}/contract/getCheckupInfoByContractTemplateId?contractTemplateId=${param.contractTemplateId}`),// 查询确实前会审单信息
    // saveContractWord:(param) => request.post(`${apiUrl}/contract/saveContractWord`, param),// 保存合同word编辑后信息
    // getLeasingContractPage:(param) => request.post(`${apiUrl}/rentOut/getLeasingContractPage`, param)// 合同退租 - 分页查询租赁中的合同
    getRentOutWord:(contractId) => request.get(`${apiUrl}/rentOut/cache/getRentOutWord?contractId=${contractId}`),// 第一步，根据合同编号获取word
    getBindDataWord:(rentOutId) => request.get(`${apiUrl}/rentOut/cache/getBindDataWord?rentOutId=${rentOutId}`),// 第二步，获取word
    saveRentOutWord:(param) => request.post(`${apiUrl}/rentOut/cache/saveRentOutWord`, param),// 第二步，保存退租合同
    getCheckupInfo:(rentOutId) => request.get(`${apiUrl}/rentOut/cache/getCheckupInfo?rentOutId=${rentOutId}`),// 第三步，获取未提交审核退租会审信息
    saveCheckupInfo:(param) => request.post(`${apiUrl}/rentOut/saveCheckupInfo`, param),// 第三步，提交审核
    getRentingOutInfo:(rentOutId) => request.get(`${apiUrl}/rentOut/getCheckupInfo?rentOutId=${rentOutId}`), // 获取已提交审核的退租会审信息
    getOutContractDraftVo:(param) => request.get(`${apiUrl}/rentOut/getOutContractDraftVo`,{params:param}) // 获取退租详情
}

